//
//  NSString+Tool.m
//  ErJie
//
//  Created by 金姚 on 2017/4/1.
//  Copyright © 2017年 yaorenjin. All rights reserved.
//

#import "NSString+Tool.h"

@implementation NSString (Tool)

+ (NSString *)transform:(NSString *)chinese
{
    NSMutableString *pinyin = [chinese mutableCopy];
    CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformMandarinLatin, NO);
    CFStringTransform((__bridge CFMutableStringRef)pinyin, NULL, kCFStringTransformStripCombiningMarks, NO);
    NSString* pinyinString = [pinyin stringByReplacingOccurrencesOfString:@" " withString:@""];
    return pinyinString;
}
@end
